﻿@model IEnumerable<WeChat.Models.CourseSelectionStudent>
@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>课程评价</title>
    <style type="text/css">

        body {
            padding: 10px;
            margin: 0;
        }

        td {
            height: 50px;
            border-bottom: 1px solid #eee;
        }

        .table {
            width: 100%;
            font-size: .2rem;
            text-align: center;
            margin-top: 20px;
        }

        .del-btn {
            background: red;
            color: #fff;
            border-radius: 2px;
            padding: 4px 0;
            display:block;
            text-decoration:none;
        }
    </style>
    <script type="text/javascript">
        (function () {
            var docEl = document.documentElement;
            var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize';
            var recalc = function () {
                    var clientWidth = docEl.clientWidth;
                    if (!clientWidth) return;
                    if (clientWidth >= 640) {
                        docEl.style.fontSize = '100px';
                    } else{
                        docEl.style.fontSize = 100 * (clientWidth / 640) + 'px';
                    }
                };
            if (!document.addEventListener) return;
            window.addEventListener(resizeEvt, recalc, false);
            document.addEventListener('DOMContentLoaded', recalc, false);
            recalc();
        })()
    </script>
</head>
<body>
	<table class="table" id="myTable" border="0" cellpadding="0" cellspacing="0">
		<thead>
			<tr>
				<th style="width: 20%">课程名称</th>
				<th style="width: 30%">课程日期</th>
				<th style="width: 18%">时间</th>
				<th style="width: 15%">学员</th>
				<th style="width: 17%">操作</th>
			</tr>
		</thead>
        <tbody>
            @foreach (var item in Model)
            {
            <tr>
                <td>
                    @item.Selection.Course.CourseName
                </td>
                <td>
                    @(item.Selection.CourseDate.ToString("yyyy-MM-dd"))
                </td>
                @{
                    if ((int)item.Selection.CourseDate.DayOfWeek == 0 || (int)item.Selection.CourseDate.DayOfWeek == 6)
                    {
                        switch (item.Selection.LessonNO)
                        {
                            case 0:
                                <td>9:30</td>
                                break;
                            case 1:
                                <td>10:30</td>
                                break;
                            case 2:
                                <td>13:45</td>
                                break;
                            case 3:
                                <td>14:45</td>
                                break;
                            case 4:
                                <td>15:45</td>
                                break;
                            case 5:
                                <td>18:00</td>
                                break;
                            case 6:
                                <td>19:10</td>
                                break;
                        }
                    }
                    else
                    {
                        switch (item.Selection.LessonNO)
                        {
                            case 0:
                                <td>9:30</td>
                                break;
                            case 1:
                                <td>10:30</td>
                                break;
                            case 2:
                                <td>14:30</td>
                                break;
                            case 3:
                                <td>15:30</td>
                                break;
                            case 4:
                                <td>16:30</td>
                                break;
                            case 5:
                                <td>18:10</td>
                                break;
                            case 6:
                                <td>19:10</td>
                                break;
                        }
                    }
                }
                <td>
                    @Html.DisplayFor(modelItem => item.StudentInfo.NickName)
                </td>
                <td>
                    <a asp-action="EvaluateCourse" asp-route-id="@item.SelectionStudentID" class="del-btn">评价</a>
                </td>
            </tr>
            }
        </tbody>
	</table>
</body>
</html>
